package com.main;

import com.selectlight.BrightnessExceptions;
import com.selectphoto.CallCamera;

import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;

public class ControlMain {
    public static void main(String[] args) throws IOException {

        // 需要定时执行的任务
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                try {
                    BrightnessExceptions.brightnessException(CallCamera.selectpng());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        };
        // Timer定时器工具
        Timer timer = new Timer();
        // 延迟(首次执行的时间)
        long delay = 0;
        // 间隔周期(/毫秒数)
        long intevalPeriod = 5 * 1000;
        //立即执行，并且每5秒执行一次
        timer.schedule(task, delay, intevalPeriod);
    }
}
